﻿using System;
using System.Collections.Generic;
using System.Text;
using TSVNAddin.SVN;

namespace TSVNAddin.Core
{
	public class VersionControlProxy
	{
		private readonly IVersionControl _VersionControl;
		private Dictionary<string, VersionControlStatus> _Cache = new Dictionary<string, VersionControlStatus>();

		public VersionControlProxy(IVersionControl versionControl)
		{
			_VersionControl = versionControl;
		}

		public VersionControlStatus GetStatus(string path)
		{
			if (!_Cache.ContainsKey(path))
				_Cache.Add(path, _VersionControl.GetStatus(path));

			return _Cache[path];
		}
	}
}
